package Text;
/*class B {
    public int Func() {
        System.out.print("B");
        return 0;
    }
}
class D extends B {
    @Override
    public int Func() {
        System.out.print("D");
        return 0;
    }
}
public class Text {
    public static void main(String[] args) {
        B a = new B();
        B b = new D();
        a.Func();
        b.Func();
    }
}
*/

class X{
    public X(){
        System.out.print("X");
    }
    Y y=new Y();

}
class Y{
    public Y(){
        System.out.print("Y");
    }
}
 class Z extends X{
    Y y=new Y();
    public Z(){
        System.out.print("Z");
    }
}

public class Text {
    public static void main(String[] args) {
        new Z();
    }
}